package com.rejia.jldemo.utils;

import cn.hutool.core.img.ImgUtil;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class Imagebase64 {

    public static void base64StringToImage(String base64String, String filePath) {
        try {
            BufferedImage bi1 = ImgUtil.toImage(base64String);
            File f1 = new File(filePath);
            ImageIO.write(bi1, "jpg", f1);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}